package edu.whu.tao.constant;

/**
 * 
 * <P>通用常量类</P>
 * @author 陶焕(13294175866)
 * @date 2016年4月17日 下午7:40:53
 */
public class CommonConstants {

	private CommonConstants(){
		
	}
	
	/** 标准日期格式,没有分割符 */
	public final static String NORM_DATE_PATTERN_WITHOUT_SEPARATOR = "yyyyMMdd";
	
	/** 标准日期时间格式，精确到秒,没有分割符 */
	public final static String NORM_DATETIME_PATTERN_WITHOUT_SEPARATOR = "yyyyMMddHHmmss";
	
	public static final String STR_EMPTY = "";
	
	public static final String STR_ALL = "不限";
	
	public static final String STR_PLEASE_SELECT = "请选择";
	
	public static final String STR_PERCENT = "%";
	
	/**
	 * 控制器中常用键值
	 */
	public static final String SUCCESS_KEY = "success";
	
	public static final String MESSAGE_KEY = "message";
	
	public static final String DATA_KEY = "data";
	
	public static final String ERROR_KEY = "error";
	
	public static final String USER_KEY = "user";
	
	public static final String ROLES_KEY = "roles";
	
	public static final String FORWARD = "forward:";
	
	public static final String REDIRECT = "redirect:";
	
	/**
	 * 数据库配置中常用键值
	 */
	public static final String DB_USER_KEY = "user";
	
	public static final String DB_PWD_KEY = "password";
	
	/**
	 * combo-box键值常量
	 */
	public static final String COMBO_ID = "id";
	
	public static final String COMBO_TEXT = "text";
	
	public static final String DEFAULT_CHARSET_STR = "UTF-8";
	
	/**
	 * 实体状态:0 ：正常 ,-1 ： 删除
	 */
	public static final int STATE_NOR = 0; 
	
	public static final int STATE_DEL = -1;
	
	/**
	 * 批量保存和更新的数量
	 */
	public static final int BATCH_COUNT = 30;
	
	/**
	 * 分页时默认请求的页数
	 */
	public static final int DETAULT_PAGE = 1;
	
	/**
	 * 分页时默认请求的数据行数
	 */
	public static final int DETAULT_ROWS = 20;
	
	/**
	 * 排序常量
	 */
	public static final String ASC = "ASC";
	
	public static final String DESC = "DESC";
	
	
	/******************* 通用 START ****************************/
	
	public static final String QUERY_SUCCESS = "查询成功";
	
	public static final String QUERY_FAILURE = "查询失败";
	
	public static final String INSERT_SUCCESS = "插入成功";
	
	public static final String INSERT_FAILURE = "插入失败";
	
	public static final String UPDATE_SUCCESS = "更新成功";
	
	public static final String UPDATE_FAILURE = "更新失败";
	
	public static final String DELETE_SUCCESS = "删除成功";
	
	public static final String DELETE_FAILURE = "删除失败";
	
	
	/******************* 通用 END ****************************/
	
	public static final String DELETE_NOT_ALL_MSG_TPL = "预计删除{}条数据,实际删除{}条数据,有{}条数据因被引用无法删除";
	
	public static final String DELETE_CANCEL_BY_CITE = "数据因被引用无法删除";
	
	/**
	 * 请求时必须带的参数
	 */
	/**
	 * 客户端参数
	 */
	public static final String CLIENT = "_client";
	
	/**
	 * api版本
	 */
	public static final String API_VERSION = "_apiVersion";
	

}
